Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • #46
    Originally posted by Gabriel Kwenda View Post

    Hi Tom,

    I did follow up and i was able to understand and recreate the fixed effects from the example 3. But i still have a setback.

    When i used the procedure with my data set, stata reported back that i have "insufficient observations".

    I know that this means i needed to boost up my sample size.
    ​​​​​​
    ​​​​​​Here is my experience:
    ✓ I have 27 country pairs with Exporting country of interest (Malawi). I started with 2001 to 2019 hence 514 observations. This was the first fail at generating fixed effects.
    ✓ second i expanded from 2001 to 1991. Failed again.
    ✓ third, i expanded further to 1962, nothing changed.

    I have considered using "months instead of years" as time frame but issue of getting the required variables in months has been a setback.

    Will using the ppmlhdfe without applying the fixed effects be okay?

    Kind regards
    Gabriel
    Hi Gabriel,
    If Malawi is the only exporting country in your data then you cannot use importer-time FEs because your data only varies by importer and time. Since you don't have any observations that vary within importer-time (which would require there being another exporter aside from Malawi), ppmlhdfe is telling you you cannot estimate the coefficients you are interested in. Thus, one simple thing you can do is drop the importer-time fixed effect. You can instead control for things like the log of importer GDP and log importer GDP per capita. Among other things, this would control for the fact that Malawi is more likely to trade with larger countries.
    Regards,
    Tom

    Comment


    • #47
      Dear Tom Zylkin,

      I would really appreciate your help. I am looking to regress a single country's exports (Ireland's) on gravity's standard variables (distance, contiguity, language, trade agreements etc.) from 2000-2020, and I am looking to use the ppmlhdfe command. However, as suggested by numerous posts before, I need to account for multilateral resistances. I understand from previous statalisters' posts that as I will only have one exporter (Ireland), importer-time fixed effects are not needed.

      My aim is to find how the values of standard gravity variables (the main one being contiguity, which is basically an Ireland-UK dummy) have changed pre- and post-Brexit referendum (2016). In my understanding, won't including exporter-time fixed effects mean that the time-invariant variables will be collinear with the exporter fixed effects, thereby dropping them from the model? I have also read that remoteness indices have been used in the past to proxy multilateral resistances for Nx1 papers, but Head and Mayer (2014) argue against their use.

      Essentially, how would you suggest I incorporate these multilateral resistances? Yotov et al. (2016) and many papers strongly suggest to include these terms, so it would be great if I could include them in my model if possible. Would I need outwards and inwards multilateral resistances? I have also read lots of NxN studies using exporter-time fixed effects on Stata, but I have not seen any Nx1 studies (like mine) using them.

      Apologies for the lengthy message. Any advice would be great!

      Kind regards,

      Ronan

      Comment


      • #48
        Originally posted by Ronan Moore View Post
        Dear Tom Zylkin,

        I would really appreciate your help. I am looking to regress a single country's exports (Ireland's) on gravity's standard variables (distance, contiguity, language, trade agreements etc.) from 2000-2020, and I am looking to use the ppmlhdfe command. However, as suggested by numerous posts before, I need to account for multilateral resistances. I understand from previous statalisters' posts that as I will only have one exporter (Ireland), importer-time fixed effects are not needed.

        My aim is to find how the values of standard gravity variables (the main one being contiguity, which is basically an Ireland-UK dummy) have changed pre- and post-Brexit referendum (2016). In my understanding, won't including exporter-time fixed effects mean that the time-invariant variables will be collinear with the exporter fixed effects, thereby dropping them from the model? I have also read that remoteness indices have been used in the past to proxy multilateral resistances for Nx1 papers, but Head and Mayer (2014) argue against their use.

        Essentially, how would you suggest I incorporate these multilateral resistances? Yotov et al. (2016) and many papers strongly suggest to include these terms, so it would be great if I could include them in my model if possible. Would I need outwards and inwards multilateral resistances? I have also read lots of NxN studies using exporter-time fixed effects on Stata, but I have not seen any Nx1 studies (like mine) using them.

        Apologies for the lengthy message. Any advice would be great!

        Kind regards,

        Ronan
        Dear Ronan,

        Technically, if Ireland is the only exporter, then an exporter-time fixed effect becomes like a time fixed effect. Then it would cause any variables that vary over time, but not across importers to be dropped. So it would not be a problem for including time-invariant variables that vary across importers.

        To describe some other options for fixed effects, an exporter-importer fixed effect here becomes an importer fixed effect. This would absorb all time-invariant variables. Thus, if you want to include things like distance, you would not include this. You also cannot include importer-time FEs because your data only varies by importer and time. It therefore is not possible to control for multilateral resistance in the usual way here. Using remoteness indices may not be recommended for case where you have many exporters and importers, but it may be a worthwhile option here. You should also control for GDP and GDP per capita and other importer-specific variables.

        Having said that, one question I have is, if you mainly care about the effect of Brexit (a time-varying variable), why are the coefficients for distance and other time invariant variables important to the analysis?

        Regards,
        Tom

        Comment


        • #49
          Dear Tom Zylkin,

          Thank you very much for your fast reply! I have a few questions in response to your post:

          1) If I control for multilateral resistances with remoteness indices, then should I still include the time fixed effect/exporter fixed effect?

          2) Sorry about the confusion. I initially wanted to create a Brexit dummy variable but I was struggling with how to make one. In essence, I wanted to use the Brexit dummy to either find the effect of the referendum in 2016 on Irish-UK trade, or just the effect of the referendum on total Irish exports instead. However, the simpler option was to just compute two separate regressions for all of the gravity variables - a pre 2016 regression separately from a 2016 onwards, and perhaps compare the values of the different gravity variables. Obviously, these differences would not all come from Brexit, so it would be a more implied approach.

          I have been using the CEPII gravity database for my regressions so far. Below is an example regression I would perform without the Brexit dummy. I also cluster by country pairs and I do not include country pair fixed effects:

          Code:
          ppmlhdfe tradeflow_comtrade_d  EXPORTER_TIME_FE*  lnGDP_impor  lnGDPpercapita_impor population_impor distance contiguity commonlang_off col_dep_ever if exporter != importer, cluster(pair_id)
          Even though it is clear that the above equation does not make sense as the exporter-time fixed effects would be colinear with the time-variant variables such as GDP, I included them to give an example of the possible variables I would include in a regression.

          If you have any suggestions about how to construct a Brexit dummy variable, and any example code that would be great! I very much appreciate your help, and please let me know if there is any more information you need.

          Kind regards,

          Ronan
          Last edited by Ronan Moore; 29 Mar 2023, 14:54.

          Comment


          • #50
            Ronan Moore Perhaps you have figured this out already, but if I understand correctly, creating a Brexit dummy should simply be:
            Code:
            gen brexit = year>=2016

            Comment


            • #51
              Andrew Bernal thank you for your suggestion. I was wondering if for Irish UK trade in particular if I had to interact this Brexit dummy with a UK dummy too. I was also wondering if this Brexit dummy would be too simplistic i.e. not explain the full effect of the Brexit referendum on Irish trade changes (in particular with the UK).

              Comment


              • #52
                On second thought, my suspicion is that a Brexit dummy would be omitted for collinearity once you include year fixed effects. So it may not be informative/necessary to include it. You can test it yourself to see if this is the case.

                Further, there should also be no need for a UK dummy. I believe this would be accounted for as long you include a "trade partner" fixed effect. Again, test this to see if this is the case.

                Comment


                • #53
                  How would you suggest I assess the trade impacts of the Brexit referendum on Irish trade then? Apologies for the confusion, and would you have an example code?

                  Comment


                  • #54
                    Dear Tom Zylkin.
                    I'am new on this forum. I'm trying to estimate separately intensive and extensive margins of subsaharian african trade using gravity model. I would like to know how to use the commands (either ppml_panel_sg or ppmlhdfe ) to make these estimations.
                    Thanks in advance

                    Regards,
                    Steve

                    Comment

                    Working...
                    X